<template>
	<scroll-view scroll-y="true" class="pop-bg-compare" >
		<view class="pop-bg-compare-item" v-for="(item,index) in assessList" @click="assessCompare(item)" :key="index">
			<image :src="getAssessLevelCover(item)" style="width: 100rpx;height: 100rpx;margin-left: 20rpx;"></image>
			<view style="display: flex;flex-direction: column;margin-left: 20rpx;margin-right: 20rpx;">
				<text class="pop-bg-compare-item-title">心理行为测评报告</text>
				<text class="pop-bg-compare-item-time">{{item.evaluateTime}}</text>
			</view>
		</view>
	</scroll-view>
</template>

<script>
	export default {
		name: "AssessCompareView",
		props: {
			assessList: {
				type: Array,
				default() {
					return []
				}
			},
			evaluateRecordId: {
				type: String,
				default() {
					return '';
				}
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			getAssessLevelCover(item) {
				if (item.rating === 'A++') {
					return '../../../static/assess-level-1.png';
				} else if (item.rating === 'A+') {
					return '../../../static/assess-level-2.png';
				} else if (item.rating === 'A') {
					return '../../../static/assess-level-3.png';
				} else if (item.rating === 'B') {
					return '../../../static/assess-level-4.png';
				} else if (item.rating === 'B-') {
					return '../../../static/assess-level-5.png';
				}
				return '';
			},
			
			assessCompare(item) {
				if (item.evaluateRecordId === this.evaluateRecordId) {
					uni.showToast({
						title: '不能与当前测评进行比较',
						icon: 'none'
					})
					return;
				}
				this.$emit('compareClick')
				uni.navigateTo({
					url: '/pages-assess/assess-compare/assess-compare?evaluateRecordId=' + this.evaluateRecordId +
						'&comparingWithId=' + item.evaluateRecordId
				})
			},
			
		}
	}
</script>

<style lang="scss">
	.pop-bg-compare {
		display: flex;
		flex-direction: column;
		align-items: center;
		background-color: #FFFFFF;
		border-radius: 12rpx;
		width: 652rpx;
		height: 1044rpx;
	}

	.pop-bg-compare-item {
		display: flex;
		flex-direction: row;
		align-items: center;
		width: 608rpx;
		height: 134rpx;
		background: linear-gradient(136deg, rgba(250, 204, 48, 1) 0%, rgba(247, 224, 144, 1) 100%);
		opacity: 1;
		border-radius: 4px;
		margin-left: 24rpx;
		margin-right: 20rpx;
		margin-top: 10rpx;
		margin-bottom: 10rpx;
		@include assess-result-share-bg();
	}

	.pop-bg-compare-item-title {
		font-size: 36rpx;
		font-weight: bold;
		color: rgba(255, 255, 255, 1);
		opacity: 1;
		margin-left: 20rpx;
		margin-top: 18rpx;
	}

	.pop-bg-compare-item-time {
		margin-left: 20rpx;
		margin-top: 24rpx;

		font-size: 20rpx;
		color: rgba(255, 255, 255, 1);
		opacity: 0.81;
	}
</style>
